home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.4
- date 90.02.16.13.47.18; author rab; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 89.07.26.23.45.40; author rab; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 89.07.20.07.40.42; author rab; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 89.07.19.17.16.25; author rab; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.4
- log
- @*** empty log message ***
- @
- text
- @/*
- * sun23Print.c --
- *
- * Contains the machine specific routine for printing the size if the
- * machine is a sun2 or sun3 (they both have the same a.out format).
- *
- * Copyright 1989 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: /a/newcmds/size/RCS/printMips.c,v 1.3 89/07/26 23:45:40 rab Exp Locker: rab $";
- #endif /* not lint */
-
- #include <assert.h>
-
- #ifndef mips
- #define mips 1
- #endif
-
- #ifndef LANGUAGE_C
- #define LANGUAGE_C 1
- #endif
-
- #ifndef MIPSEL
- #define MIPSEL
- #endif
-
- #if 0
- #include <ds3100.md/aouthdr.h>
- #include <ds3100.md/filehdr.h>
- #include <ds3100.md/scnhdr.h>
- #include <ds3100.md/sys/exec.h>
- #include <ds3100.md/nlist.h>
- #endif
-
- #include <ds3100.md/a.out.h>
- #include "size.h"
-
-
- /*
- *----------------------------------------------------------------------
- *
- * PrintMips --
- *
- * Prints out the size information for a decStation 3100
- *
- * Results:
- * SUCCESS if size information was printed, FAILURE otherwise.
- *
- * Side effects:
- * Stuff is printed.
- *
- *----------------------------------------------------------------------
- */
-
- ReturnStatus
- PrintMips(fp, printName, fileName, printHeadings, bufferSize, buffer)
- FILE *fp; /* file that header was read from */
- Boolean printName; /* TRUE => print name of file */
- char *fileName; /* name of file */
- Boolean printHeadings; /* TRUE => print column headings */
- int bufferSize; /* size of buffer */
- char *buffer; /* buffer containing header */
- {
-
- struct exec *header;
- struct aouthdr *aoutheader;
- char swappedHeader[sizeof(*header) * 2];
- int swappedSize = sizeof(swappedHeader);
- int status;
-
- assert(HEADERSIZE >= sizeof(struct exec));
- if (bufferSize < sizeof(struct exec)) {
- return FAILURE;
- }
- header = (struct exec *) buffer;
- aoutheader = &header->ex_o;
- /*
- * See if the magic number is ok. If it is not, and the format
- * is not mips format, then swap to little-endian and see if
- * that fixes it.
- */
- if (N_BADMAG(*aoutheader) && (FMT_MIPS_FORMAT != hostFmt)) {
- status = Fmt_Convert("{h2w3h2h2w13}", FMT_MIPS_FORMAT, &bufferSize,
- buffer, hostFmt, &swappedSize, swappedHeader);
- if (status) {
- fprintf(stderr, "Fmt_Convert returned %d.\n", status);
- return FAILURE;
- }
- header = (struct exec *) swappedHeader;
- aoutheader = &header->ex_o;
- if (N_BADMAG(*aoutheader)) {
- return FAILURE;
- }
- }
- if (printHeadings) {
- printf("%-7s %-7s %-7s %-7s %-7s\n",
- "text", "data", "bss", "dec", "hex");
- }
- printf("%-7d %-7d %-7d %-7d %-7x",
- header->a_text, header->a_data, header->a_bss,
- header->a_text + header->a_data + header->a_bss,
- header->a_text + header->a_data + header->a_bss);
- if (printName) {
- printf("\t%s\n", fileName);
- } else {
- printf("\n");
- }
- return SUCCESS;
- }
- @
-
-
- 1.3
- log
- @Added support for ds3100.
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /a/newcmds/size/RCS/printMips.c,v 1.2 89/07/20 07:40:42 rab Exp Locker: rab $";
- d24 1
- a24 1
- #define mips
- d27 5
- a31 1
- #define LANGUAGE_C
- d33 1
- d35 4
- d40 3
- d73 2
- a74 1
- struct exec *header;
- d84 7
- a90 4
- if (!N_BADMAG(*header)) {
- goto doPrint;
- }
- if (FMT_MIPS_FORMAT != hostFmt) {
- d98 3
- a100 2
- if (!N_BADMAG(*header)) {
- goto doPrint;
- a102 2
- return FAILURE;
- doPrint:
- @
-
-
- 1.2
- log
- @*** empty log message ***
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header: /a/newcmds/size/RCS/printMips.c,v 1.1 89/07/19 17:16:25 rab Exp $";
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d18 1
- a18 1
- static char rcsid[] = "$Header$";
- d71 3
- @
-